Skip to content

fix(patch): cherry-pick ea48bd9 to release/v0.31.0-preview.1-pr-20577 [CONFLICTS]#20592

Merged
galdawave merged 2 commits into
release/v0.31.0-preview.1-pr-20577from
hotfix/v0.31.0-preview.1/0.31.0-preview.2/preview/cherry-pick-ea48bd9/pr-20577
Feb 27, 2026
Merged

fix(patch): cherry-pick ea48bd9 to release/v0.31.0-preview.1-pr-20577 [CONFLICTS]#20592
galdawave merged 2 commits into
release/v0.31.0-preview.1-pr-20577from
hotfix/v0.31.0-preview.1/0.31.0-preview.2/preview/cherry-pick-ea48bd9/pr-20577

Conversation

@gemini-cli-robot

Copy link
Copy Markdown
Collaborator

This PR automatically cherry-picks commit ea48bd9 to patch version v0.31.0-preview.1 in the preview release to create version 0.31.0-preview.2.

⚠️ Merge Conflicts Detected

This cherry-pick resulted in merge conflicts that need manual resolution.

🔧 Next Steps:

  1. Review the conflicts: Check out this branch and review the conflict markers
  2. Resolve conflicts: Edit the affected files to resolve the conflicts
  3. Test the changes: Ensure the patch works correctly after resolution
  4. Update this PR: Push your conflict resolution

📋 Files with conflicts:

The commit has been created with conflict markers for easier manual resolution.

🚨 Important:

  • Do not merge this PR until conflicts are resolved
  • The automated patch release will trigger once this PR is merged

Co-authored-by: Gal Zahavi <38544478+galz10@users.noreply.github.com>
# Conflicts:
#	packages/cli/src/test-utils/render.tsx
#	packages/cli/src/ui/AppContainer.tsx
#	packages/cli/src/ui/contexts/UIActionsContext.tsx
@gemini-cli-robot gemini-cli-robot requested a review from a team as a code owner February 27, 2026 18:41
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the user experience for handling account suspension errors within the CLI. By introducing a specialized error type and a dedicated dialog, the application can now provide users with more specific and actionable information when their account is suspended due to Terms of Service violations. This change refines the authentication flow, ensuring that account suspension details, including appeal options, are clearly communicated to the user, rather than being presented as a generic authentication failure.

Highlights

  • Enhanced Error Handling for Account Suspensions: Introduced a dedicated AccountSuspendedError class and logic to specifically identify and handle Terms of Service violation errors (403 TOS_VIOLATION) from API responses, distinguishing them from general forbidden errors.
  • Structured Authentication Results: The performInitialAuth function now returns a structured object (InitialAuthResult) that includes both general authentication errors and specific AccountSuspensionInfo when an account suspension is detected.
  • Dedicated Banned Account User Interface: A new BannedAccountDialog component has been added to present users with clear information about account suspensions, including appeal URLs and options to change authentication or exit the application.
  • Improved UI State Management: The UI state and actions have been updated across various components to incorporate and manage the accountSuspensionInfo, allowing the application to react appropriately to account suspension events and provide relevant user interactions.
Changelog
  • packages/cli/src/core/auth.test.ts
    • Updated performInitialAuth test expectations to match the new structured return type.
    • Added a test case for handling 403 TOS_VIOLATION errors and extracting accountSuspensionInfo.
  • packages/cli/src/core/auth.ts
    • Refactored performInitialAuth to return an InitialAuthResult object, distinguishing between general auth errors and account suspension details.
    • Integrated isAccountSuspendedError to detect and process account suspension errors.
  • packages/cli/src/core/initializer.test.ts
    • Adjusted mock return values and assertions for performInitialAuth and initializeApp to align with the new InitialAuthResult structure.
  • packages/cli/src/core/initializer.ts
    • Modified InitializationResult interface to include accountSuspensionInfo.
    • Updated initializeApp to correctly handle and propagate the new structured authentication result.
  • packages/cli/src/gemini.test.tsx
    • Updated mockInitializationResult to include accountSuspensionInfo.
  • packages/cli/src/test-utils/AppRig.tsx
    • Extended authentication mocks and AppContainer props to support accountSuspensionInfo.
  • packages/cli/src/test-utils/render.tsx
    • Added mocks for new UIActions methods: getPreferredEditor and clearAccountSuspension.
  • packages/cli/src/ui/AppContainer.tsx
    • Updated useAuthCommand to handle accountSuspensionInfo and exposed clearAccountSuspension action.
  • packages/cli/src/ui/auth/BannedAccountDialog.test.tsx
    • Added new test file for BannedAccountDialog component.
  • packages/cli/src/ui/auth/BannedAccountDialog.tsx
    • Added new React component to display account suspension information and options.
  • packages/cli/src/ui/auth/snapshots/BannedAccountDialog.test.tsx.snap
    • Added snapshot test for BannedAccountDialog.
  • packages/cli/src/ui/auth/useAuth.ts
    • Updated useAuthCommand to manage accountSuspensionInfo state and handle AccountSuspendedError during authentication.
  • packages/cli/src/ui/components/DialogManager.tsx
    • Integrated BannedAccountDialog to be displayed when an account suspension is detected.
  • packages/cli/src/ui/contexts/UIActionsContext.tsx
    • Expanded the UIActions interface with new methods for editor preferences and clearing account suspension.
  • packages/cli/src/ui/contexts/UIStateContext.tsx
    • Defined AccountSuspensionInfo interface and added accountSuspensionInfo to UIState.
  • packages/core/src/utils/errors.test.ts
    • Added tests for AccountSuspendedError detection and parsing in toFriendlyError.
  • packages/core/src/utils/errors.ts
    • Introduced AccountSuspendedError class to specifically represent account suspension due to TOS violations.
    • Modified toFriendlyError to prioritize detection of TOS_VIOLATION errors and return AccountSuspendedError.
    • Added isAccountSuspendedError helper function.
Activity
  • This pull request is an automated cherry-pick of commit ea48bd9414a0e1de735933211680dcced3731946 to create a new patch version 0.31.0-preview.2.
  • Merge conflicts were detected during the cherry-pick process, requiring manual resolution.
  • The author is instructed to review and resolve conflicts, test the changes, and update the PR.
  • The PR should not be merged until all conflicts are resolved, and the automated patch release will trigger upon successful merge.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request cherry-picks a commit to handle account suspension errors, which can occur due to Terms of Service violations. The changes introduce a new AccountSuspendedError type, update the authentication flow to detect this error, and add a new BannedAccountDialog to inform the user and provide an appeal link. The changes are well-implemented and tested. However, there are unresolved merge conflict markers in three files that must be addressed before this PR can be merged, as highlighted in the specific comments.

Comment thread packages/cli/src/test-utils/render.tsx Outdated
Comment thread packages/cli/src/ui/AppContainer.tsx Outdated
Comment thread packages/cli/src/ui/contexts/UIActionsContext.tsx Outdated
@gemini-cli gemini-cli Bot added the status/need-issue Pull requests that need to have an associated issue. label Feb 27, 2026
@github-actions

Copy link
Copy Markdown

Size Change: +6.63 kB (+0.03%)

Total Size: 25.7 MB

Filename Size Change
./bundle/gemini.js 25.2 MB +6.63 kB (+0.03%)
ℹ️ View Unchanged
Filename Size
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 221 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 227 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 11.5 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB
./bundle/sandbox-macos-strict-open.sb 4.82 kB
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB

compressed-size-action

@galdawave galdawave enabled auto-merge (squash) February 27, 2026 19:51
@galdawave galdawave merged commit 3e3da76 into release/v0.31.0-preview.1-pr-20577 Feb 27, 2026
25 checks passed
@galdawave galdawave deleted the hotfix/v0.31.0-preview.1/0.31.0-preview.2/preview/cherry-pick-ea48bd9/pr-20577 branch February 27, 2026 19:51
@sripasg sripasg added the size/l A large sized PR label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/l A large sized PR status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants